package com.flying.oop_demo1;

/**
 * @author 刘鹏飞
 * @ClassName Dog
 * @Date 2024/12/2 22:16
 * @Created by 刘鹏飞
 * @Description 测试类的声明
 */
public class Dog {
    public String name;   // 默认初始化值  null
    int age;              // 默认值    0
    String color;
    Boolean jueyu;  // 默认值 false

    // 构造器 的重载
    public Dog() {
    }

    public Dog(String name) {
        this.name = name;
    }

    public Dog(String name, int age, String color, Boolean jueyu) {
        this.name = name;
        this.age = age;
        this.color = color;
        this.jueyu = jueyu;
    }

    public void eat(String food) {
        System.out.println("狗在吃" + food);
    }


    public void shut() {
        System.out.println("狗在叫");
    }

    public void sleep() {
        System.out.println("狗在睡觉");
    }

}
